package server;

import java.util.LinkedList;

public class TagStack {

	private LinkedList<String> stack;

	public synchronized String[] getStack() {
		String[] ret = {};
		return (String[]) stack.toArray(ret);

	}

	public synchronized LinkedList<String> getlistStack() {
		LinkedList<String> ret = new LinkedList<String>(stack);
		return ret;

	}

	public TagStack() {
		this.stack = new LinkedList<String>();
	}

	public synchronized String pop(int i) {
		return this.stack.get(i);
	}

	public synchronized String remove(int i) {
		return this.stack.remove(i);
	}

	public synchronized void set(LinkedList<String> stack) {
		this.stack = stack;
	}

	public synchronized boolean isEmpty() {
		return this.stack.isEmpty();
	}

}
